\begin{figure}
\begin{algorithmic}[1]
\STATE \code{class Entry<\underline{O,I},E> \lb} \label{Entry:start}
\STATE \code{~~E element;}
\STATE \code{~~Entry<\underline{O,I},E> next, prev;} \label{Entry:next}
\STATE \code{\rb} \label{Entry:end}
\STATE \code{class LinkedList<\underline{O,I},E> \lb}  \label{OIGJ:LinkedList}
\STATE \code{~~Entry<\underline{This,I},E> header;} \label{OIGJ:header}
\STATE \code{~~\underline{<I extends Raw>?} LinkedList() \lb} \label{OIGJ:Raw:ctor1}
\STATE \code{~~~~this.header = new Entry<\underline{This,I},E>();} \label{OIGJ:Raw:I1}
\STATE \code{~~~~header.next = header.prev = header;} \label{OIGJ:assignment:ctor1} %\myCOMMENT{Illegal in IGJ}
\STATE \code{~~\rb}
\STATE \code{~~\underline{<I extends Raw>?} LinkedList(} \label{OIGJ:Raw:ctor2}
\STATE \code{~~~~~~~~~~~~~~~~~Collection<\underline{?,ReadOnly},E> c) \lb}
\STATE \code{~~~~this();~~this.addAll(c);} \label{OIGJ:call-ctor1}
\STATE \code{~~\rb}
\STATE \code{~~\underline{<I extends Raw>?} void addAll(} \label{OIGJ:addAll:definition}
\STATE \code{~~~~~~~~~~~~~~~~~Collection<\underline{?,ReadOnly},E> c) \lb}
\STATE \code{~~~~Entry<\underline{This,I},E> succ = this.header,} \label{OIGJ:Raw:I2} %\myCOMMENT{successor}
\STATE \code{~~~~~~~~~~~~~~~~~~~~pred = succ.prev;} %\myCOMMENT{predecessor}
\STATE \code{~~~~for (E e : c) \lb}
\STATE \code{~~~~~~Entry<\underline{This,I},E> en=new Entry<\underline{This,I},E>();}
\STATE \code{~~~~~~en.element=e; en.next=succ;~en.prev=pred;}
\STATE \code{~~~~~~pred.next = en;~~pred = en;~~\rb} \label{OIGJ:assignment:addAll} %\myCOMMENT{Illegal in IGJ}
\STATE \code{~~~~succ.prev = pred;} \label{OIGJ:assignment:addAll:prev}
\STATE \code{~~\rb} \label{OIGJ:Raw:end}
\STATE \code{~~int size() \lb\ldots\rb} \label{OIGJ:size}
\STATE \code{~~}\myCOMMENT{\code{iterator} is a generic method; this is not a cJ guard:}
\STATE \code{~~\underline{<ItrI extends ReadOnly>} Iterator<\underline{O,ItrI,I},E>} \label{OIGJ:iterator}
\STATE \code{~~~~~~~~~~~~~~~~~iterator() \lb}
\STATE \code{~~~~return this.new ListItr<\underline{ItrI}>();} \label{ListItr:create}
\STATE \code{~~\rb}
\STATE \code{~~void remove(Entry<\underline{This,Mutable},E> e) \lb}
\STATE \code{~~~~e.prev.next = e.next;} \label{ListItr:prev}
\STATE \code{~~~~e.next.prev = e.prev;} \label{ListItr:prev2}
\STATE \code{~~\rb}
\STATE \code{~~class ListItr<\underline{ItrI}> implements} \label{ListItr:start}
\STATE \code{~~~~~~~~Iterator<\underline{O,ItrI,I},E> \lb} \label{ListItr:Iterator}
\STATE \code{~~~~Entry<\underline{This,I},E> current;} \label{OIGJ:assignable} %\myCOMMENT{Illegal in IGJ}
\STATE \code{~~~~\underline{<ItrI extends Raw>?} ListItr() \lb} \label{ListItr:ctor}
\STATE \code{~~~~~~this.current = LinkedList.this.header;} \label{ListItr:ctor-assignment}
\STATE \code{~~~~\rb}
\STATE \code{~~~~\underline{<ItrI extends Mutable>?} E next() \lb} \label{ListItr:next}
\STATE \code{~~~~~~this.current = this.current.next;} \label{ListItr:next-assignment}
\STATE \code{~~~~~~return this.current.element;}
\STATE \code{~~~~\rb}
\STATE \code{~~~~\underline{<I extends Mutable>?} void remove() \lb} \label{ListItr:remove}
\STATE \code{~~~~~~LinkedList.this.remove(this.current);} \label{ListItr:remove-call}
\STATE \code{~~~~\rb}
\STATE \code{\rb~\rb}\label{ListItr:end}
%\STATE \code{\rb}
\STATE \code{interface Iterator\hgn{\underline{O,ItrI,CollectionI},E} \lb }  \label{I:Iterator}
\STATE \code{\quad boolean hasNext(); } \label{I:hasNext}
\STATE \code{\quad \underline{<ItrI extends Mutable>?} E next(); }  \label{I:next}
\STATE \code{\quad \underline{<CollectionI extends Mutable>?} void remove(); } \label{I:remove}
\STATE \code{\rb\ } \label{I:Iterator:end}
\end{algorithmic}
\caption{\code{LinkedList<\nounderline{O,I},E>} in OIGJ\@.}
%todo{Add declaration, at least, for \code{Entry} constructor.}
%we now use the default ctor defined by Java that initialize everything to 0/null
\label{Figure:OIGJ-LinkedList}
\end{figure}

% LocalWords:  prev ReadOnly addAll
